package org.springframework.sandbox.mvc;

import com.google.gson.Gson;
import com.hnair.bot.model.CsPerson;
import com.hnair.bot.service.ICsPersonService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/hello")
public class TestController {
	
	@Autowired
    private ICsPersonService dfService;

    @RequestMapping(value="/foo", produces = "text/html; charset=utf-8")
    public @ResponseBody String getShopInJSON(HttpServletRequest request, CsPerson p) {
    	//request.getAttribute(arg0)
//    	dfService.selectByTypeName();
    	
    	System.err.println(p.getBirthday());
    	dfService.insert(p);
    	dfService.selectById(p.getId());
        return "你好:"+p.toString();
    }

}
